<template>
    <van-tabbar
        v-model="active"
        class="tabbar-container"
    >
        <van-tabbar-item icon="home-o" to="/">首页</van-tabbar-item>
        <van-tabbar-item icon="apps-o" to="/category">分类</van-tabbar-item>
        <van-tabbar-item
            icon="shopping-cart-o"
            to="/shopping-cart"
            :badge="$store.state.goods_count ? $store.state.goods_count : ''"
            >购物车</van-tabbar-item
        >
        <van-tabbar-item icon="user-o" to="/user">我的</van-tabbar-item>
    </van-tabbar>
</template>

<script>
import routes from "@/router/routes"

export default {
    data() {
        return {
            active: 0,
            routes
        }
    }
}
</script>

<style lang="less">
.van-tabbar-item {
    background-color: #eee;
}
</style>
